<!DOCTYPE html>
<html>
<head>
    <title>备件设备关联</title>
    #parse("sys/header.html")
</head>
<body>
<div id="rrapp" v-cloak>
    <!-- 审核 -->
    <div id="reviewLayer" style="display: none;">
        <form class="form-horizontal" style="width: 350px;">
            <div class="form-group">
                <!--<div class="form-group">
                    <div class="col-sm-2 control-label">审核人</div>
                    <div class="col-sm-10">
                        <i-input v-model="spareDev.checkUserName" placeholder="审核人姓名"></i-input>
                    </div>
                </div>-->
                <div class="form-group">
                    <div class="col-sm-2 control-label">审核状态</div>
                    <div class="col-sm-10" style="margin-top: 6px">
                        <Radio-group v-model="spareDev.checkFlag">
                            <Radio :label="1" ><span>审核通过</span></Radio>
                            <Radio :label="2" ><span>审核不通过</span></Radio>
                        </Radio-group>
                    </div>
                </div>
            </div>
        </form>
    </div>
	<div v-show="showList">
        <Row :gutter="16" style="margin: 8px 0px 0px 1px">
            <div class="search-group">
                <i-col span="3">
                    <i-input v-model="q.name" @on-enter="query" placeholder="备件名称"></i-input>
                </i-col>
                <i-col span="3">
                    <i-input v-model="q.spec" @on-enter="query" placeholder="备件规格"></i-input>
                </i-col>
                <i-col span="3">
                    <i-input v-model="q.partCode" @on-enter="query" placeholder="备件编码"></i-input>
                </i-col>
                <i-col span="3">
                    <i-input v-model="q.erpCode" @on-enter="query" placeholder="ERP编码"></i-input>
                </i-col>
                <i-col span="3">
                    <i-input v-model="q.producor" @on-enter="query" placeholder="供应厂商"></i-input>
                </i-col>
                <i-button @click="query">查询</i-button>
                <i-button @click="reloadSearch">重置</i-button>
            </div>
        </Row>
        <Row :gutter="16" style="margin: 3px 0px 0px 0px;">
            <div class="buttons-group">
                #if($shiro.hasPermission("sparedev:review"))
                <i-button type="primary" @click="review"><i class="fa fa-gavel"></i>&nbsp;审核</i-button>
                #end
                #if($shiro.hasPermission("sparedev:save"))
                <i-button type="info" @click="getSparePart"><i class="fa fa-plus"></i>&nbsp;新增</i-button>
                #end
                #if($shiro.hasPermission("sparedev:update"))
                <i-button type="warning" @click="update"><i class="fa fa-pencil-square-o"></i>&nbsp;修改</i-button>
                #end
                #if($shiro.hasPermission("sparedev:delete"))
                <i-button type="error" @click="del"><i class="fa fa-trash-o"></i>&nbsp;删除</i-button>
                #end
            </div>
        </Row>
	    <table id="jqGrid"></table>
    </div>

    <Card v-show="!showList">
        <p slot="title">{{title}}</p>
		<i-form ref="formValidate" :model="spareDev" :rules="ruleValidate" :label-width="80">
            <Row>
                <i-col span="11">
                    <Form-item label="替换备件" prop="sparePart">
                        <i-select v-model="sparePart" @on-change="getBySpareId">
                            <i-option v-for="spare in spareList" :value="spare" :key="spare">{{spare.partCode}} {{spare.name}}
                            </i-option>
                        </i-select>
                        <!--<i-input v-model="spareDev.spareId" placeholder="备件被替换ID"></i-input>-->
                    </Form-item>
                </i-col>
                <i-col span="11" offset="2">
                    <Form-item label="申请人姓名" prop="applyUserName">
                        <i-input v-model="spareDev.applyUserName" placeholder="申请人姓名"></i-input>
                    </Form-item>
                </i-col>
            </Row>
            <Row>
                <!--<i-col span="11">
                    <Form-item label="来源" prop="source">
                        <i-input v-model="sparePart.source" placeholder="来源 0随机备件" disabled></i-input>
                    </Form-item>
                </i-col>-->
                <i-col span="11" offset="2">
                    <Form-item label="系统编码" prop="partCode">
                        <i-input v-model="sparePart.partCode" placeholder="系统编码" disabled></i-input>
                    </Form-item>
                </i-col>
            </Row>
            <Row>
                <i-col span="11">
                    <Form-item label="名称" prop="name">
                        <i-input v-model="sparePart.name" placeholder="名称" disabled></i-input>
                    </Form-item>
                </i-col>
                <i-col span="11" offset="2">
                    <Form-item label="规格" prop="spec">
                        <i-input v-model="sparePart.spec" placeholder="规格" disabled></i-input>
                    </Form-item>
                </i-col>
            </Row>
            <Row>
                <i-col span="11">
                    <Form-item label="单位" prop="unit">
                        <i-input v-model="sparePart.unit" placeholder="单位" disabled></i-input>
                    </Form-item>
                </i-col>
                <i-col span="11" offset="2">
                    <Form-item label="单价" prop="price">
                        <i-input v-model="sparePart.price" placeholder="单价" disabled></i-input>
                    </Form-item>
                </i-col>
            </Row>
            <Row>
                <i-col span="11">
                    <Form-item label="计划ABC" prop="planAbc">
                        <i-input v-model="sparePart.planAbc" placeholder="计划ABC" disabled></i-input>
                    </Form-item>
                </i-col>
                <i-col span="11" offset="2">
                    <Form-item label="安全库存" prop="safeNum">
                        <i-input v-model="sparePart.safeNum" placeholder="安全库存" disabled></i-input>
                    </Form-item>
                </i-col>
            </Row>
            <Row>
                <i-col span="11">
                    <Form-item label="初始数量" prop="initNum">
                        <i-input v-model="sparePart.initNum" placeholder="初始数量" disabled></i-input>
                    </Form-item>
                </i-col>
                <i-col span="11" offset="2">
                    <Form-item label="生产厂家" prop="producor">
                        <i-input v-model="sparePart.producor" placeholder="生产厂家" disabled></i-input>
                    </Form-item>
                </i-col>
            </Row>
            <Row>
                <i-col span="11">
                    <Form-item label="使用单位" prop="useUnit">
                        <i-input v-model="sparePart.useUnit" placeholder="使用单位" disabled></i-input>
                    </Form-item>
                </i-col>
                <i-col span="11" offset="2">
                    <Form-item label="所用工序" prop="procedure1">
                        <i-input v-model="sparePart.procedure1" placeholder="所用工序" disabled></i-input>
                    </Form-item>
                </i-col>
            </Row>
            <Row>
                <i-col span="11">
                    <Form-item label="所属设备编码" prop="devCode">
                        <i-input v-model="sparePart.devCode" placeholder="所属设备编码" disabled></i-input>
                    </Form-item>
                </i-col>
                <i-col span="11" offset="2">
                    <Form-item label="所属设备" prop="devName">
                        <i-input v-model="sparePart.devName" placeholder="所属设备" disabled></i-input>
                    </Form-item>
                </i-col>
            </Row>
            <Row>
                <i-col span="11">
                    <Form-item label="状态" prop="status">
                        <i-input v-model="sparePart.status" placeholder="状态" disabled></i-input>
                    </Form-item>
                </i-col>
                <i-col span="11" offset="2">
                    <Form-item label="ERP编码" prop="erpCode">
                        <i-input v-model="sparePart.erpCode" placeholder="ERP编码" disabled></i-input>
                    </Form-item>
                </i-col>
            </Row>
            <!--<Form-item label="审核人名称" prop="checkUserName">
                <i-input v-model="spareDev.checkUserName" placeholder="审核人名称"></i-input>
            </Form-item>
            <Form-item label="审核人ID" prop="checkUserId">
                <i-input v-model="spareDev.checkUserId" placeholder="审核人ID"></i-input>
            </Form-item>
            <Form-item label="审核标志 0未审核 1已审核" prop="checkFlag">
                <i-input v-model="spareDev.checkFlag" placeholder="审核标志 0未审核 1已审核"></i-input>
            </Form-item>
            <Form-item label="备件清单ID" prop="spareRepId">
                <i-input v-model="spareDev.spareRepId" placeholder="备件清单ID"></i-input>
            </Form-item>
            <Form-item label="设备ID" prop="devId">
                <i-input v-model="spareDev.devId" placeholder="设备ID" readonly></i-input>
            </Form-item>-->
            <Form-item>
                <i-button type="primary" @click="handleSubmit('formValidate')">提交</i-button>
                <i-button type="warning" @click="reload" style="margin-left: 8px">返回</i-button>
                <i-button type="info" @click="handleReset('formValidate')" style="margin-left: 8px">重置</i-button>
            </Form-item>
        </i-form>
	</Card>
</div>

<script src="${rc.contextPath}/js/spare/sparedev.js?_${date.systemTime}"></script>
</body>
</html>
